<!--
 * Created by PhpStorm.
 * 版权所有: 2019~2022 [ hhygyl ]
 * Date: 2019/7/23-16:24
 * Link: http://luckyadmin.luckyhhy.cn
 * FileName: edit_article.html
 *-->


{include file="public/open_head" /}


<div class="ok-body" >

    <div class="layui-fluid" >

        <form class="layui-form" style="margin-top: 30px;">

            <div class="layui-form-item " style=""  >
                <label class="layui-form-label" >所属栏目：</label >
                <div class="layui-input-inline input-custom-width">
                    <select name="navigate_id" lay-search=""  lay-verify="required" lay-verType="tips" lay-reqText="请选择栏目" >
                        <option value="">请选择栏目</option>
                        {volist name="navigate" id="v"}
                        <option value="{$v.id}" {eq name="$info.navigate_id" value="$v.id" } selected {/eq} {eq name="$v.pid" value="0" } disabled {/eq}>├─ {$v.title}</option>
                        {/volist}
                    </select>
                </div >
            </div >

            {lv:inputform  label="文章标题：" name="title" place="请输入文章标题"  verify="required" class="name" style="width: 350px;"  value="$info.title" /}

            {:token()}

            <input type="hidden" name="id" value="{$info.id}" >


            {:widget('forms/Upthumb',array('image_url|缩略图|文章缩略图||选择图片',$info.image_url,700,600,1))}

            <div class="layui-form-item">
                <label class="layui-form-label">是否推荐：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="radio" name="is_recommend" value="1" title="是" {eq name="$info.is_recommend" value="1" } checked {/eq}>
                    <input type="radio" name="is_recommend" value="0" title="否"  {eq name="$info.is_recommend" value="0" } checked {/eq}>
                </div>
                <div class="layui-form-mid layui-word-aux">用于前台推荐调用</div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">是否置顶：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="radio" name="is_top" value="1" title="是"   {eq name="$info.is_top" value="1" } checked {/eq} >
                    <input type="radio" name="is_top" value="0" title="否"  {eq name="$info.is_top" value="0" } checked {/eq}>
                </div>
                <div class="layui-form-mid layui-word-aux">用于前台置顶调用</div>
            </div>


            {lv:inputform  label="关键词：" name="keywords" place="关键词" style="width: 350px;" value="$info.keywords"  verify="required"  lang="inline" class="name"  word="关键词以英文逗号隔开" /}

            {lv:textarea label="摘要："  style="width: 450px;"  name="description"  place="请输入摘要" value="$info['description']"  /}

            {lv:inputform  label="点击量：" name="hits" value="$info.hits" place="文章点击量"  type="number" style="width: 350px;"   verify="required"  lang="inline"  word="文章的点击数量" /}

            <div class="layui-form-item "  >
                <label class="layui-form-label" >文章类型：</label >
                <div class="layui-input-inline input-custom-width "  >
                    <select name="source" >
                        <option value="原创" {eq name="$info.source" value="原创" } selected {/eq}>原创</option >
                        <option value="转载"  {eq name="$info.source" value="转载" } selected {/eq}>转载</option >
                    </select >
                </div >
                <label class="layui-form-label" >作者：</label >
                <div class="layui-input-inline input-custom-width "  >
                    <input type="text" name="author" value="{$info.author}" placeholder="文章作者" lay-verify="required" lay-verType="tips" lay-reqText="文章作者" autocomplete="off"  class="layui-input " >
                </div >

            </div >

            {:widget('forms/Ueditor',array('content|文章内容|文章内容|420',$info.content))}


            <div class="layui-form-item">

                <label class="layui-form-label">文章地址：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="text" class="layui-input" value="{$info.url}" >
                </div>

                <label class="layui-form-label">添加时间：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="text" class="layui-input" value="{$info.time_formt}">
                </div>
                <div class="layui-form-mid layui-word-aux">文章远程图片本地化</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">是否显示：</label>
                <div class="layui-input-inline input-custom-width ">

                    <select name="status" >
                        <option value="1" {eq name="$info.status" value="1" } selected {/eq}>显示</option>
                        <option value="2" {eq name="$info.status" value="2" } selected {/eq}>不显示</option>
                        <option value="3" {eq name="$info.status" value="3" } selected {/eq}>草稿文章</option>
                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">是否在首页展示文章</div>

                <label class="layui-form-label">内容首图：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="radio" name="pic" value="1" title="是"  >
                    <input type="radio" name="pic" value="0" title="否" checked>
                </div>
                <div class="layui-form-mid layui-word-aux">提取内容第一张图片为缩略图</div>
            </div>

            <div class="layui-form-item">

                <label class="layui-form-label">保存为草稿：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="radio" name="cao" value="1" title="是" >
                    <input type="radio" name="cao" value="0" title="否"  checked>
                </div>
                <div class="layui-form-mid layui-word-aux">文章保存为草稿不发布</div>

                <label class="layui-form-label">图片本地化：</label>
                <div class="layui-input-inline input-custom-width">
                    <input type="radio" name="img" value="1" title="是" >
                    <input type="radio" name="img" value="0" title="否"  checked>
                </div>
                <div class="layui-form-mid layui-word-aux">文章远程图片本地化</div>
            </div>

            {:widget('forms/submit',array('add','立即保存',2))}

        </form>

    </div >


</div >


<script >
    layui.use(['element', 'form', 'jquery', 'upload','lucky'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;
        var upload = layui.upload;
        var lucky=layui.lucky;

        /**
         * 提交表单数据
         */
        form.on('submit(add)', function (data) {
            lucky.FormSubmit("{:url('article/AddArticle')}", data.field, "table_id", 1);
            return false;
        });

    })
</script >


</body>
</html>